import os
import ruamel.yaml


def modify_config():
    config_yaml_file = '/home/ai_inference_atlas_sdk/config/config.yaml'
    load_config = ruamel.yaml.YAML()
    load_config.indent(mapping=2, sequence=4, offset=2)
    with open(config_yaml_file, "r", encoding="utf-8") as f:
        yaml_config = load_config.load(f)

    yaml_config['request_max_content_length'] = 136314880
    with os.fdopen(os.open(config_yaml_file, os.O_RDWR | os.O_CREAT | os.O_TRUNC, 0o600), 'w') as fp:
        load_config.dump(yaml_config, fp)


if __name__ == '__main__':
    modify_config()
